"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
// ============================================================================================
// 装饰器Decorator(要打开   "experimentalDecorators": true )
// 类装饰器
function log(agt) {
    console.log(agt);
    return (target) => {
        console.log(target);
    };
}
// 方法装饰器
function log1(agt) {
    console.log(agt);
    return (target, name, descriptor) => {
        console.log(target, name, descriptor);
    };
}
let Man = class Man {
    constructor(name) {
        this.name = "joLin";
        this.name = name;
        console.log("我是构造函数" + name);
    }
    say() {
        console.log("哎呦不错哦~");
    }
};
__decorate([
    log1("方法装饰器de参数")
], Man.prototype, "say", null);
Man = __decorate([
    log("类装饰器装饰器传入的参数")
], Man);
const j = new Man("jay");
console.log(j.name);
// ============================================================================================
// 泛型约束Generic
// 简单来说，就是声明一个类型变量，声明一个将来才知道具体类型的类型，实现类型复用
// function fn<j, j1>(arg: j): j {
//   // 泛型变量可以在函数内部任意地方使用
//   // var a :j1
//   return arg;
// }
// console.log(`我是${fn("jay")},哎呦不错哦~`);
// console.log(`我是${fn("jay")},我今年${fn(18)}了`);
